$(function(){
	var c=0;
	$(".banner a").click(function(){
		if(c==0){
			$(".list").slideDown(500);
			c=1;
		}else{
			$(".list").slideUp(500);
			c=0;
		}
	});
	
});
window.onload=function(){
	var cir_lear=function(){
//		抓取元素
		this.a =document.getElementsByTagName("a")[0];
		this.is =document.getElementsByTagName("i");
		this.i=0;
		This=this;
		//点击事件
		this.a.onclick=function(){
			if(This.i==0){
				var one_deg=360/This.is.length;
				for(var i=0;i<This.is.length;i++){
//					求出当前的角度
					this.deg=one_deg*i+45;
//					求出当前的坐标
					var zb=This.xy(this.deg,100);
//					把坐标赋值给元素
					This.is[i].style.left = zb.x +"px";
					This.is[i].style.top = zb.y +"px";
					This.is[i].style.transition = "2s "+i*0.5+"s";
					This.is[i].style.transform = "rotate(720deg)";
				}
				This.i=1;
			}else{
				for(var i=0;i<This.is.length;i++){
					This.is[i].style.left = "0px";
					This.is[i].style.top = "0px";
					This.is[i].style.transform = "rotate(0deg)";
				}
				This.i=0;
			}
		}
		this.xy=function(deg,r){
			var hudu=(2*Math.PI/360)*deg;
			var x=Math.sin(hudu)*r;
			var y=Math.cos(hudu)*r;
			return {"x":x,"y":y};
		}
	}
	new cir_lear();
}
